// stores/counter.js
import { defineStore } from 'pinia';

export const useCounterStore = defineStore('counter', {
	state: () => {
		return { 
			user:uni.getStorageSync('user'),
		};
	},
	unistorage: true,
	// 也可以这样定义
	// state: () => ({ count: 0 })
	actions: {
		// 报错
		setregister(data){
			this.user = data
		},
		
		setOrder(data){
			this.orderinfo = data
		},
		setuser(data){
			console.log("====12=======");
			this.user= data
			uni.setStorageSync('user', data)
		},
	},

 
});
